#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 19 22:11:20 2022

@author: liqingsimac
"""


# =============================================================================
# L = [0,1,2]
# print(L)
# print(id(L))
# def add_with_side_effects(M):
#     '''Increment the first element of the list. '''
#     M[0] += 1
#     
# add_with_side_effects(L)
# print(L)
# print(id(L))
# 
# =============================================================================

# =============================================================================
# L = [0,1,2]
# print(L)
# print(id(L))
# def add_without_side_effects(M):
#     ''' Increment the first element of the list. '''
#     MC = M[ : ]
#     MC[0] += 1
#     return(MC)
# 
# L = add_without_side_effects(L)
# print(L)
# print(id(L))
# =============================================================================


# =============================================================================
# def average(*args):
#     ''' Return mean of a non-empty tuple of numbers. '''
#     print(args)
#     sum = 0.0
#     for x in args:
#         sum += x
#     return(sum/len(args))
# 
# print(average(1,2,3,4))
# print(average(1,2,3,4,5))
# 
# =============================================================================


# =============================================================================
# def show(a,b,*args, **kwargs):
#     print(a,b,args,kwargs)
#     
# show(1.3, 2.7, 3, 4.2, alpha=0.99, gamma=5.67)
# 
# =============================================================================


# =============================================================================
# name = input('What is your name?')
# print('Your name is ' + name)
# =============================================================================


# =============================================================================
# ilist = input('Enter an explicit list: ')
# print(ilist)
# =============================================================================

# =============================================================================
# it = 10
# y = 2
# mystr = 'After iteration %5d, the solution was %10.3f ' % (it, y)
# print(mystr)
# =============================================================================


# =============================================================================
# f = lambda x: x+1
# print(f(1))
# =============================================================================

# =============================================================================
# f=lambda x,y: 'yes' if x==y else 'no'
# print(f(0,1))
# print(f(1,1))
# 
# g=lambda x,y: (x,y,x+y)
# print(g(1,2))
# =============================================================================


# =============================================================================
# #File frac.py
# #import numpy as np
# 
# class Frac:
#     ''' Fractional class. A Frac is a pair of integers 
#     num, den, (with den!=0) whose gcd is 1. '''
#     
#     def __init__(self,n,d):
#         ''' Construct a Frac from intergers n and d.
#         Needs error message if d=0. '''
# #        hcf=np.gcd(n,d)
# #        self.num, self.den = n/hcf, d/hcf
#         self.num, self.den = n, d
# 
#     def __str__(self):
#         ''' Generate a string representation of a Frac. '''
#         return '%d/%d' %(self.num,self.den)
#     def __mul__(self, another):
#         ''' Multiply two Fracs to produce a Frac. '''
#         return Frac(self.num*another.num, self.den*another.den)
#     def __add__(self,another):
#         ''' Add two Fracs to produce a Frac. '''
#         return Frac(self.num*another.den+self.den*another.num,
#                     self.den*another.den)
#     def to_real(self):
#         ''' Return floating point value of Frac. '''
#         return float(self.num/self.den)
#     
# if __name__ == '__main__':
#     a=Frac(3,7)
#     b=Frac(24,56)
#     print('a.num= ',a.num,', b.den= ', b.den)
#     print(a)
#     print(b)
#     print('floating point value of a is', a.to_real())
#     print('product=', a*b, ', sum=', a+b)    
#     
# =============================================================================
    








